import { PropsWithChildren } from "react";
import { useLaunch } from "@tarojs/taro";
import { Provider } from "react-redux";
import store from "./store";
// 解决小程序不支持createAsyncThunk的问题
import "event-target-polyfill"; // 解决小程序不支持EventTarget的问题
import "yet-another-abortcontroller-polyfill"; // 解决小程序不支持AbortController的问题
import "./app.scss";

function App({ children }: PropsWithChildren<any>) {
  useLaunch(() => {
    console.log("App launched.");
  });

  // children 是将要会渲染的页面
  return <Provider store={store}>{children}</Provider>;
}

export default App;
